﻿#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import os
from orioluspith.packets.script import Script

class ScriptReader:
    def read(self, scripts_dir):
        scripts = {}
        for item in os.listdir(scripts_dir):
            if os.path.isfile(os.path.join(scripts_dir, item)):
                script_name = ".".join(item.split(".")[:-1])
                scripts[script_name] = Script(script_name, os.path.abspath(os.path.join(scripts_dir, item))) 
                
        return scripts